package com.caine.androidtask.ls22;

import com.caine.androidtask.R;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;


public class MySwitchButton extends LinearLayout{
  private TextView text;
  private Button btn;

	
  public MySwitchButton(Context context){
	  super(context);
  }
	public MySwitchButton(final Context context, AttributeSet attrs) {
		super(context, attrs);
		// TODO Auto-generated constructor stub
		LayoutInflater layout = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		layout.inflate(R.layout.caine_ls22_main, this);
		text = (TextView) findViewById(R.id.txt_1);
		btn = (Button) findViewById(R.id.btn_1);
		//btn.setOnClickListener();
	}
	public void setText(String str){
		text.setText(str);
	}
	
	public void setImageResource(int resid){
		btn.setBackgroundResource(resid);
	}
	
	public void setBtnOnClickListener(View.OnClickListener ls){
		btn.setOnClickListener(ls);
	}
}
